package com.yft.service.competence;

import com.yft.dao.competence.SysCompetenceDao;
import com.yft.entity.base.Order;
import com.yft.entity.base.Pager;
import com.yft.entity.competence.SysCompetence;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 
 * @author zhangming
 *
 */
@Service("sysCompetenceService")
public class SysCompetenceServiceImpl implements SysCompetenceService{
	Logger log = Logger.getLogger(this.getClass());
	
	@Autowired(required = true)
	private SysCompetenceDao sysCompetenceDao;
	
	@Override
	public List<SysCompetence> getSysCompetenceList(SysCompetence condition,Order order,Pager pager){
		return sysCompetenceDao.getSysCompetenceList(condition, order, pager);
	}
	
	@Override
	public Integer addSysCompetence(SysCompetence sysCompetence) {
		Object o = sysCompetenceDao.addSysCompetence(sysCompetence);
		return o == null ? null : (Integer)o;
	}
	
	@Override
	@Transactional
	public Integer addSysCompetenceWithTr(SysCompetence sysCompetence) {
		return this.addSysCompetence(sysCompetence);
	}

	@Override
	public SysCompetence getSysCompetence(Integer sysCompetencePK) {
		return sysCompetenceDao.getSysCompetence(sysCompetencePK);
	}
	
}
